package com.wwg;

public class Test {

    public static void main(String[] args) {

        Singleton s1 = Singleton.getInstance();
        Singleton s2 = Singleton.getInstance();

        if(s1 == s2) {
            System.out.println("s1和s2是同一个实例");
        }else {
            System.out.println("s1和s2不是同一个实例");
        }

        SingletonTwo s3 = SingletonTwo.getInstance();
        SingletonTwo s4 = SingletonTwo.getInstance();

        if(s3 == s4) {
            System.out.println("s3和s4是同一个实例");
        }else {
            System.out.println("s3和s4不是同一个实例");
        }
    }

}
